﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using QzEbook.AccessObject;
using System.Collections.Generic;
using System.Text;

public partial class admin_manager_Category : System.Web.UI.UserControl
{
    private StringBuilder sb;
    protected void Page_Load(object sender, EventArgs e)
    {
        bindData();
    }

    private void bindData()
    {
        Category category = new Category();
        List<Category> list = category.selectList();

        sb= new StringBuilder();
        int countBook = 0;
        sb.Append("<ul id=\"categoryList\">");
        foreach (Category item in list)
        {
            sb.AppendFormat("<li>{0}</li>", Category.getLinkHtml(item.Id, item.Count));
        }
        sb.Append("</ul>");
    }

    protected override void Render(HtmlTextWriter writer)
    {
        if (sb != null)
        {
            writer.Write(sb.ToString());
        }
        base.Render(writer);
    }
}
